SPB Git

Repository Public MIT

page.tsx 709 B 15 lines tsx

1import type { Metadata } from "next";2import { ArtifactView, loadArtifact } from "@/components/artifact-view";34type P = { params: Promise<{ namespace: string; slug: string }> };56export async function generateMetadata({ params }: P): Promise<Metadata> {7  const { namespace, slug } = await params;8  const { a } = await loadArtifact(namespace, slug);9  return { title: `@${a.namespace}/${a.slug}`, description: a.summary, alternates: { canonical: `/@${a.namespace}/${a.slug}` }, robots: a.visibility === "public" ? undefined : { index: false } };10}11export default async function Page({ params }: P) {12  const { namespace, slug } = await params;13  return <ArtifactView namespace={namespace} slug={slug} />;14}15
Files main
Menu

Theme